package com.计划任务;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

import java.text.SimpleDateFormat;
import java.util.Date;

@Service
public class ScheduledTaskService {
	private static SimpleDateFormat simpleDateFormat =
			new SimpleDateFormat("HH:mm:ss");

	@Scheduled(fixedRate = 5000)
	public void test1() {
		System.out.println("每隔5s执行一次"+simpleDateFormat.format(new Date()));
	}
}
